import { MjWeaveItem } from "./MjWeaveItem";

export class MjHuTypeModel {

    public huType: number = 0
    public huTypeZu: Map<number, number> = new Map<number, number>()//
    public huData: number = 0
    public leftDataList: Array<number>;
    public leftDataAndHuData: Array<number>
    public jiangData: number = 0; //将牌 或者说是对眼的牌
    public mjWeaveList: Array<MjWeaveItem>
    public allDataList: Array<number>
    public leftRightList: Array<Array<number>> = []
    public allRightList: Array<Array<number>> = []
    public dianpao:number = 0
    public isQianggang:boolean = false  //是否抢杠胡


    public model2json(){
        let obj:object = {
            "huType":this.huType,
            "huTypeZu":{},
            "huData":this.huData,
            "leftDataList":this.leftDataList,
            "leftDataAndHuData":this.leftDataAndHuData,
            "jiangData":this.jiangData,
            "mjWeaveList":this.mjWeaveList,
            "allDataList":this.allDataList,
            "leftRightList":this.leftRightList,
            "allRightList":this.allRightList,
            "dianpao":this.dianpao,
        }
        this.huTypeZu.forEach((value:number, key:number) => {
            obj["huTypeZu"][key] = value;
        });
        return obj
    }

}